<?php
class Keke_witkey_task_wbdj_work_class{
	public $_db;
	public $_tablename;
	public $_dbop;
	public $_djwk_id;	public $_task_id;	public $_work_id;	public $_wb_type;	public $_click_num;	public $_wb_url;	public $_jump_url;	public $_wb_account;	public $_wb_sid;	public $_get_cash;	public $_wb_data;	public $_ip;
	public $_cache_config = array ('is_cache' => 0, 'time' => 0 );
	public $_replace=0;
	public $_where;
	function  keke_witkey_task_wbdj_work_class(){		$this->_db = new db_factory ( );		$this->_dbop = $this->_db->create(DBTYPE);		$this->_tablename = TABLEPRE."witkey_task_wbdj_work";	}	 
	public function getDjwk_id(){		return $this->_djwk_id ;	}	public function getTask_id(){		return $this->_task_id ;	}	public function getWork_id(){		return $this->_work_id ;	}	public function getWb_type(){		return $this->_wb_type ;	}	public function getClick_num(){		return $this->_click_num ;	}	public function getWb_url(){		return $this->_wb_url ;	}	public function getJump_url(){		return $this->_jump_url ;	}	public function getWb_account(){		return $this->_wb_account ;	}	public function getWb_sid(){		return $this->_wb_sid ;	}	public function getGet_cash(){		return $this->_get_cash ;	}	public function getWb_data(){		return $this->_wb_data ;	}	public function getIp(){		return $this->_ip ;	}	public function getWhere(){		return $this->_where ;	}	public function getCache_config() {		return $this->_cache_config;	}
	public function setDjwk_id($value){		$this->_djwk_id = $value;	}	public function setTask_id($value){		$this->_task_id = $value;	}	public function setWork_id($value){		$this->_work_id = $value;	}	public function setWb_type($value){		$this->_wb_type = $value;	}	public function setClick_num($value){		$this->_click_num = $value;	}	public function setWb_url($value){		$this->_wb_url = $value;	}	public function setJump_url($value){		$this->_jump_url = $value;	}	public function setWb_account($value){		$this->_wb_account = $value;	}	public function setWb_sid($value){		$this->_wb_sid = $value;	}	public function setGet_cash($value){		$this->_get_cash = $value;	}	public function setWb_data($value){		$this->_wb_data = $value;	}	public function setIp($value){		$this->_ip = $value;	}	public function setWhere($value){		$this->_where = $value;	}	public function setCache_config($_cache_config) {		$this->_cache_config = $_cache_config;	}
	public  function __set($property_name, $value) {
		$this->$property_name = $value;
	}
	public function __get($property_name) {
		if (isset ( $this->$property_name )) {
			return $this->$property_name;
		} else {
			return null;
		}
	}
		function create_keke_witkey_task_wbdj_work(){		$data =  array();		if(!is_null($this->_djwk_id)){			$data['djwk_id']=$this->_djwk_id;		}		if(!is_null($this->_task_id)){			$data['task_id']=$this->_task_id;		}		if(!is_null($this->_work_id)){			$data['work_id']=$this->_work_id;		}		if(!is_null($this->_wb_type)){			$data['wb_type']=$this->_wb_type;		}		if(!is_null($this->_click_num)){			$data['click_num']=$this->_click_num;		}		if(!is_null($this->_wb_url)){			$data['wb_url']=$this->_wb_url;		}		if(!is_null($this->_jump_url)){			$data['jump_url']=$this->_jump_url;		}		if(!is_null($this->_wb_account)){			$data['wb_account']=$this->_wb_account;		}		if(!is_null($this->_wb_sid)){			$data['wb_sid']=$this->_wb_sid;		}		if(!is_null($this->_get_cash)){			$data['get_cash']=$this->_get_cash;		}		if(!is_null($this->_wb_data)){			$data['wb_data']=$this->_wb_data;		}		if(!is_null($this->_ip)){			$data['ip']=$this->_ip;		}		return $this->_djwk_id = $this->_db->inserttable($this->_tablename,$data,1,$this->_replace);	}
		function edit_keke_witkey_task_wbdj_work(){		$data =  array();		if(!is_null($this->_djwk_id)){			$data['djwk_id']=$this->_djwk_id;		}		if(!is_null($this->_task_id)){			$data['task_id']=$this->_task_id;		}		if(!is_null($this->_work_id)){			$data['work_id']=$this->_work_id;		}		if(!is_null($this->_wb_type)){			$data['wb_type']=$this->_wb_type;		}		if(!is_null($this->_click_num)){			$data['click_num']=$this->_click_num;		}		if(!is_null($this->_wb_url)){			$data['wb_url']=$this->_wb_url;		}		if(!is_null($this->_jump_url)){			$data['jump_url']=$this->_jump_url;		}		if(!is_null($this->_wb_account)){			$data['wb_account']=$this->_wb_account;		}		if(!is_null($this->_wb_sid)){			$data['wb_sid']=$this->_wb_sid;		}		if(!is_null($this->_get_cash)){			$data['get_cash']=$this->_get_cash;		}		if(!is_null($this->_wb_data)){			$data['wb_data']=$this->_wb_data;		}		if(!is_null($this->_ip)){			$data['ip']=$this->_ip;		}		if($this->_where){			return $this->_db->updatetable($this->_tablename,$data,$this->getWhere());		}		else{			$where = array('djwk_id' => $this->_djwk_id);			return $this->_db->updatetable($this->_tablename,$data,$where);		}	}
		function query_keke_witkey_task_wbdj_work($is_cache=0, $cache_time=0){		if($this->_where){			$sql = "select * from $this->_tablename where ".$this->_where;		}		else{			$sql = "select * from $this->_tablename";		}		if ($is_cache) {			$this->_cache_config ['is_cache'] = $is_cache;		}		if ($cache_time) {			$this->_cache_config ['time'] = $cache_time;		}		if ($this->_cache_config ['is_cache']) {			if (CACHE_TYPE) {				$keke_cache = new keke_cache_class ( CACHE_TYPE );				$id = $this->_tablename . ($this->_where?"_" .substr(md5 ( $this->_where ),0,6):'');				$data = $keke_cache->get ( $id );				if ($data) {					return $data;				} else {					$res = $this->_dbop->query ( $sql );					$keke_cache->set ( $id, $res,$this->_cache_config['time'] );					$this->_where = "";					return $res;				}			}		}else{			$this->_where = "";			return  $this->_dbop->query ( $sql );		}	}
		function count_keke_witkey_task_wbdj_work(){		if($this->_where){			$sql = "select count(*) as count from $this->_tablename where ".$this->_where;		}		else{			$sql = "select count(*) as count from $this->_tablename";		}		$this->_where = "";		return $this->_dbop->getCount($sql);	}
		function del_keke_witkey_task_wbdj_work(){		if($this->_where){			$sql = "delete from $this->_tablename where ".$this->_where;		}		else{			$sql = "delete from $this->_tablename where djwk_id = $this->_djwk_id ";		}		$this->_where = "";		return $this->_dbop->execute($sql);	}
}
?>